﻿@using PlatformNetCore.Entity;
@model SafetyInfo

<div class="banner banner-safety" style="background-image:url(@(Model.Ad != null && !string.IsNullOrWhiteSpace(Model.Ad.AdImagePC) ? Model.Ad.AdImagePC:"/img/banner/dosage.jpg"))">
    <div class="txt">
        <div class="nav-container">
            <h1 class="text28 wow fadeInUp">@ViewBag.ParentTitle</h1>
            <ul class="nav wow fadeInUp">
                @foreach (Menu item in ViewBag.MenuTopSecond)
                {
                    <li><a href="@item.Link" class="@(item.MenuCode.Equals(ViewBag.MenuCode)?"active":"")">@item.Title</a></li>
                }
            </ul>
        </div>
    </div>
</div>

<div class="page page-safety">
    @if (Model.SinglePage != null)
    {
        @Html.Raw(Model.SinglePage.Content)
    }
    @if (Model.Videos.Any())
    {
        <section class="s3">
            <div class="container">
                <div class="title-section wow fadeInUp">
                    <h2>课题组</h2>
                    <h3>VIDEOS</h3>
                </div>
                <div class="row">
                    @foreach (var item in Model.Videos)
                    {
                        <div class="col-md-4">
                            <a class="item wow fadeInUp" href="javascript:void(0);" data-url="@item.VideoPath" data-poster="/image/467/329/@item.CoverImage">
                                <img src="/image/467/329/@item.CoverImage" alt="@item.Title">
                                <div class="play"><img src="/img/play.png" alt=""></div>
                            </a>
                        </div>
                    }
                </div>
            </div>
        </section>
        <div class="overly" id="overly">
            <div class="video-container">
                <div class="video-header">
                    <div class="video-title" id="video-title">视频播放</div><a class="btnClose" id="btnClose" href="javascript:void(0);"> <i class="iconfont icon-searchclose"></i></a>
                </div>
                <div class="video_wrap" id="youkuplayer">
                    <video id="vid" src="" poster="" autoplay controls></video>
                </div>
            </div>
        </div>
    }
</div>
@section scripts{
    <script>
        $(function () {
            $("#btnClose").click(function (e) {
                $("#overly").fadeOut();
            });
            $('.s3 .item').click(function () {
                var videoSrc = $(this).attr('data-url');
                var poster = $(this).attr('data-poster');
                $('#overly').fadeIn(200);
                $('.video_wrap video').attr('poster', poster);
                $('.video_wrap video').attr('src', videoSrc);
                $('.video_wrap video')[0].play();
                //$("#videoshow").text(title);
            });
        });
    </script>
}
